$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'spiceinit'

class Person;end

person = Person.inspiced(:accessors => {:name => "Lucky", :last_name => "Luke", :is_cool? => true}, 
                         :track_spices => true)
p person
# => #<Person:0x9040c @is_cool=true, @name="Lucky", @last_name="Luke">
p [person.name,person.last_name,person.is_cool?]
# => ["Lucky", "Luke", true]
p person.spices_added
# => ["name", "last_name", "name=", "is_cool=", "is_cool?", "last_name="]

person = Person.inspiced(:readers => {:name => "Lucky", :last_name => "Luke", :is_cool? => true}, 
                         :track_spices => true)
p person
# => #<Person:0x8fd04 @is_cool=true, @name="Lucky", @last_name="Luke">
p [person.name,person.last_name,person.is_cool?]
# => ["Lucky", "Luke", true]
p person.spices_added
# => ["name", "last_name", "is_cool?"]

person = Person.inspiced(:readers => {:name => "Lucky", :last_name => "Luke"}, 
                         :accessors => {:is_cool? => true}, 
                         :track_spices => true)
p person
# => #<Person:0x8f6ec @is_cool=true, @name="Lucky", @last_name="Luke">
p [person.name,person.last_name,person.is_cool?]
# => ["Lucky", "Luke", true]
p person.spices_added
# => ["name", "last_name", "is_cool=", "is_cool?"]

person = Person.inspiced(:readers => {:name => "Lucky", :last_name => "Luke"}, :track_spices => true)
p person
# => #<Person:0x8f0ac @name="Lucky", @last_name="Luke">
p person.spices_added
# => ["name", "last_name"]

person = Person.inspiced(:accessors => {:name => "Lucky", :last_name => "Luke"}, :track_spices => true)
p person
# => #<Person:0x8ecec @name="Lucky", @last_name="Luke">
p person.spices_added
# => ["name", "last_name", "name=", "last_name="]
class Person
  attr_accessor :kind
  def initialize(kind=nil)
    @kind = kind
  end
end
person = Person.inspiced('comic',:accessors => {:name => "Lucky", :last_name => "Luke"}, :track_spices => true)
p person
# #<Person:0x8d720 @kind="comic", @last_name="Luke", 
# @spices_added=["name", "name=", "last_name", "last_name="], @name="Lucky">
puts
person = Person.inspiced(:accessors => {:name => "Lucky", :last_name => "Luke"}) do |ll|
  ll.kind = 'comic'
end
person.kind = 'Comic'
p person.kind
# => "Comic"
p person
# <Person:0x8d324 @kind="comic", @last_name="Luke", @name="Lucky">
